package cn.hg.jboot.core.exception;

import cn.hg.jboot.core.constant.BaseConstants;
import io.jboot.exception.JbootException;

/**
 * @author 胡高
 * @date 2021/10/28
 */
public class BaseServiceException extends JbootException {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 4560718886767512047L;

    private int code = BaseConstants.RETURN_CODE_VALUE_SUCCESSED;

    public BaseServiceException(int code, String msg) {
        super(msg);
        this.code = code;
    }

    public BaseServiceException(Throwable cause) {
        super(BaseConstants.RETURN_MESSAGE_VALUE_FAILED, cause);
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

}
